<?php

namespace app\http\middleware;

use think\facade\Request;

class CrossDomain
{
    public function handle($request, \Closure $next)
    {
        header('Access-Control-Allow-Origin:*');
        header('Access-Control-Allow-Methods:*');
        header('Access-Control-Allow-Headers:*');
        dump(1111);
        if (strtoupper($request->method()) == "OPTIONS") {
            return response();
        }



        return $next($request);
    }
}